// pages/buycoffee/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    addressInfo: {
      id: 0,
      address: '大连甘井子'
    },
    typeList: [
      {
        id: 0,
        title: '经典推荐'
      },
      {
        id: 1,
        title: '热门咖啡'
      },
      {
        id: 2,
        title: '特价优惠'
      },
      {
        id: 3,
        title: '特价优惠特价优惠特价优惠'
      },
    ],
    goodsList: [
      {
        id: 0,
        title: 'ming',
        price: '4.6',
        image_url: 'https://img1.baidu.com/it/u=411120157,91708223&fm=253&fmt=auto&app=138&f=PNG?w=889&h=500',

      },
      {
        id: 0,
        title: 'ming',
        price: '45.6',
        image_url: 'https://img1.baidu.com/it/u=411120157,91708223&fm=253&fmt=auto&app=138&f=PNG?w=889&h=500',
      },
      {
        id: 0,
        title: 'ming',
        price: '45.6',
        image_url: 'https://img1.baidu.com/it/u=411120157,91708223&fm=253&fmt=auto&app=138&f=PNG?w=889&h=500',
      },
      {
        id: 0,
        title: 'ming',
        price: '45.6',
        image_url: 'https://img1.baidu.com/it/u=411120157,91708223&fm=253&fmt=auto&app=138&f=PNG?w=889&h=500',
      },
      {
        id: 0,
        title: 'ming',
        price: '45.6',
        image_url: 'https://img1.baidu.com/it/u=411120157,91708223&fm=253&fmt=auto&app=138&f=PNG?w=889&h=500',
      },
      {
        id: 0,
        title: 'ming',
        price: '45.6',
        image_url: 'https://img1.baidu.com/it/u=411120157,91708223&fm=253&fmt=auto&app=138&f=PNG?w=889&h=500',
      },
      {
        id: 0,
        title: 'ming',
        price: '45.6',
        image_url: 'https://img1.baidu.com/it/u=411120157,91708223&fm=253&fmt=auto&app=138&f=PNG?w=889&h=500',
      },

    ],
    typeId: 0,
    orderInfo: {
      number: 2,
      price: 45,
      oldprice: 125
    }

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  clickType(e) {
    const index = e.currentTarget.dataset.item.id
    this.setData({
      typeId: index
    })
  },

  toShopCar() {
    console.log('45454');
  },

  toAccount() {
    wx.navigateTo({
      url: '/pages/getorder/index',

    });

  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})